let getQueryStringArgs = function () {
  let qs1 = (location.search.length > 0 ? location.search.substring(1) : ''),
      args = {};

  for (let item of qs1.split("&").map(kv => kv.split('='))) {
    let name = decodeURIComponent(item[0]),
        value = decodeURIComponent(item[1]);
    if (name.length) {
      args[name] = value
    }
  }
  return args;
}

let qs = "?name=hua&age=12";

let searchParams = new URLSearchParams(qs);

console.log(searchParams.toString()); // name=hua&age=12;
searchParams.has('age');  // true
searchParams.get('age');  // 12

searchParams.set('sex', '1');
console.log(searchParams.toString()); // name=hua&age=12&sex=1;

searchParams.delete('age');
console.log(searchParams.toString());  // name=hua&sex=1


